package com.spring.control;

import java.util.List;

import org.springframework.stereotype.Controller;
import org.springframework.util.CollectionUtils;

import com.spring.annoation.RequesUrl;
import com.spring.bean.PageVo;
import com.spring.http.HttpContext;

@Controller
public class IndexControl {
	@RequesUrl("/test")
	public String test(HttpContext context, PageVo page) throws Exception {
		System.out.println(page);
		System.out.println("test");
		return "测试结果";
	}

	@RequesUrl("/index")
	public String index(HttpContext context, PageVo page) throws Exception {
		return "index";
	}

	@RequesUrl("/list")
	public List<String> list(HttpContext context, PageVo page) throws Exception {
		@SuppressWarnings("unchecked")
		List<String> arrayToList = CollectionUtils.arrayToList(new String[]{"12","12"});
		return arrayToList;
	}
	@RequesUrl("/name")
	public String name(HttpContext context,Float name,PageVo page) throws Exception {
		System.out.println(page);
		System.out.println("name"+name);
		return name+"page"+page;
	}

}
